{extend name="../../index/view/public/layout" /}
{block name="style"}
<link rel="stylesheet" href="__STATIC__/member/css/member.css">
	<link rel="stylesheet" href="__STATIC__/member/css/index.css">
{/block}
{block name="main-container"}
<div class="member-container wrapper clearfix">
    {include file="public/left" /}
    <div class="member-main">
        <div class="total-info clearfix">
            <div class="assets-info clearfix">
                <div class="item">
                    <div class="title">资产总计(元) <i class="icon icon-question"></i></div>
                    <div class="con">
                        <span class="number-red number-xlarge">{$money.total|money_convert}</span>
                    </div>
                </div>
                <div class="item">
                    <div class="title">可用余额(元) <i class="icon icon-question"></i></div>
                    <div class="con">
                        <span class="number-red number-xlarge">{$money.account|money_convert}</span>
                    </div>
                </div>
                <div class="item">
                    <div class="title">操盘金额(元) <i class="icon icon-question"></i></div>
                    <div class="con">
                        <span class="number-red number-xlarge">{$money.operate_account|money_convert}</span>
                    </div>
                </div>
                <div class="item">
                    <div class="title">保证金(元) <i class="icon icon-question"></i></div>
                    <div class="con">
                        <span class="number-red number-xlarge">{$money.bond_account|money_convert}</span>
                    </div>
                </div>
            </div>
            <div class="operator">
                <a href="{:URL('money/recharge/index')}" class="btn btn-block btn-red">充值</a>
                <a href="{:URL('money/withdraw/index')}" class="btn btn-block btn-primary">提现</a>
            </div>
            <div class="wave"></div>
            <div class="wave wave2"></div>
        </div>
        <div class="renewal-setting clearfix">
            <div class="title">
                自动续期说明
            </div>
            <div class="help-msg">
                若余额充足，到期自动续期1天、1周或者1月（免费体验、免息配资除外，自动续期没有推荐人奖励）。
            </div>

        </div>
        <div class="financing-section">
            <div class="financing-section-hd clearfix">
                <h3>我的配资</h3>
                <a href="{:URL('member/financing/index')}" class="fr">查看更多配资记录</a>
            </div>
            {notempty name="borrow"}
            <ul class="financing-list">
                {foreach name="borrow" item="bw"}
                <li class="item">
                    <div class="item-hd">
                        <div class="fr operator">
                            {if condition="$bw['status'] eq 1"}
                            {if condition="($bw['type'] neq '免息配资') and ($bw['type'] neq '免费体验')"}
                            <span>自动续期</span>
                            <span data-id="{$bw.id}"  class="btn-switch auto-renewal-btn  {if condition="$bw['renewal'] eq 1"}active{/if} ">
                                <span></span>
                            </span>
                            {/if}
                            {/if}
                        </div>
                        单号：<span class="order-sn">{$bw->order_id}</span>
                        {eq name="bw['status']" value="1"}
                            <span class="tag">{$bw->status_text}</span>
                        {else/}
                            <span class="tag tag-disabled">{$bw->status_text}</span>
                        {/eq}
                        <span style="margin-left: 2px"><img width="18" height="18" src="__STATIC__/home/img/{$bw.imgsType}"</span>
                    </div>
                    <div class="item-bd clearfix">
                        <div class="unit">
                            <div class="title">操盘资金</div>
                            <div class="value">{$bw->init_money|money_convert=###}元</div>
                        </div>
                        <div class="unit">
                            <div class="title">借入资金</div>
                            <div class="value">{$bw->borrow_money|money_convert=###}元</div>
                        </div>
                        <div class="unit">
                            <div class="title">风险保证金</div>
                            <div class="value">{$bw->deposit_money|money_convert=###}元</div>
                        </div>
                        <div class="unit">
                            <div class="title">{$bw.management}</div>
                            <div class="value">{$bw->borrow_interest|money_convert=###}元</div>
                        </div>
                        {if condition="$bw['status'] eq -1"}
                        <div class="unit">
                            <div class="title">股票可用金额</div>
                            <div class="value">--</div>
                        </div>
                        <div class="unit">
                            <div class="title">股票市值</div>
                            <div class="value">--</div>
                        </div>
                        <div class="unit">
                            <div class="title">股票盈亏</div>
                            <div class="value">--</div>
                        </div>
                        {elseif condition="$bw['status'] eq 0"}
                        <div class="unit">
                            <div class="title">股票可用金额</div>
                            <div class="value">--</div>
                        </div>
                        <div class="unit">
                            <div class="title">股票市值</div>
                            <div class="value">--</div>
                        </div>
                        <div class="unit">
                            <div class="title">股票盈亏</div>
                            <div class="value">--</div>
                        </div>
                        {else/}
                        <div class="unit">
                            <div class="title">股票可用金额</div>
                            <div class="value">{$bw.avail|money_convert=###}元</div>
                        </div>
                        <div class="unit">
                            <div class="title">股票市值</div>
                            <div class="value">{$bw.sum_money}元</div>
                        </div>
                        <div class="unit">
                            <div class="title">股票盈亏</div>
                            <div class="value">{$bw.return_money}</div>
                        </div>
                        {/if}
                    </div>
                    <div class="item-ft clearfix">
                        {in name="bw['status']" value='1,2'}
                            操盘时间：{$bw->verify_time | date="Y-m-d", ###} 至 {$bw->end_time | date="Y-m-d", ###}
                        {/in}

                        <div class="btn-group">
                            {if condition="$bw['status'] eq 1"}
                            <a href="/market/index/index?u={$bw['sub_account']}" target="market" class="red">查看实盘交易</a>
                            {/if}
                            <a href="/member/financing/details?id={$bw->id}">配资详情</a>
                        </div>
                    </div>
                </li>
                {/foreach}
                <!--<div style="float: right;">{$borrow->render()}</div>-->
            </ul>
            {else/}
            <div class="stock-empty">
                <div class="wrap">
                    <img src="__STATIC__/member/img/exclamation.gif" alt="">
                    <div>
                        您还没有申请配资<br/>
                        快去 <a href="{:url('@stock/day')}">申请配资>></a>
                    </div>
                </div>
            </div>
            {/notempty}
        </div>
    </div>
</div>
<script>
    // 自动续期开关
    $(".btn-switch").switchAutoRenewalBtn();
</script>
{/block}